import { createRouter, createWebHashHistory } from "vue-router"
import Login from '../components/login/Login.vue'
import UserHome from '../components/userhome/UserHome.vue'
import UserOne from '../components/userhome/UserOne.vue'
import Usermine from '../components/userhome/Usermine.vue'
import Userbiology from '../components/userhome/Userbiology.vue'
import Personal from '../components/userhome/Personal.vue'
import Userabout from '../components/userhome/Userabout.vue'
import Dministrators from '../components/administrators/Dministrators.vue'
import Register from '../components/login/Register.vue'
import Addgood from '../components/administrators/Addgood.vue'
import Goodgoods from '../components/administrators/Goodgoods.vue'
import Examine from '../components/administrators/Examine.vue'
import Adminiinformation from '../components/administrators/Adminiinformation.vue'
import Usage from '../components/administrators/Usage.vue'
import Success from '../components/userhome/Success.vue'
const Router = createRouter({
    history: createWebHashHistory(),
    routes: [
        {
            //将默认路径显示首页
            path: '/',
            
            redirect: "/login"
        },

        {
            path: '/login',
            component: Login,
            name: "Login",
        },
        {
            path: '/register',
            component: Register,
            name: "Register",
        },
        {
            path: '/userhome',
            component: UserHome,
            name: "userhome",
            children: [{
                path: '/userone',
                component: UserOne,
                name: "userone",
            },
            {
                path: '/usermine',
                component: Usermine,
                name: "usermine",
            },
            {
                path: '/userbiology',
                component: Userbiology,
                name: "userbiology",
            },
            {
                path: '/personal',
                component: Personal,
                name: "personal",
            },
            {
                path: '/userabout',
                component: Userabout,
                name: "userabout",

            },
            {
                path: '/success',
                component: Success,
                name: "Success",

            },
            ],
        },
        {
            path: '/administrators',
            component: Dministrators,
            name: "Administrators",
            children: [
                {
                    path: '/goodgoods',
                    component: Goodgoods,
                    name: "Goodgoods",
                },
                {
                    path: '/addgood',
                    component: Addgood,
                    name: "Addgood",

                },
                {
                    path: '/examine',
                    component: Examine,
                    name: "Examine",

                },
                {
                    path: '/adminiinformation',
                    component: Adminiinformation,
                    name: "Adminiinformation",

                },
                {
                    path: '/usage',
                    component: Usage,
                    name: "Usage",

                },
            ],
        }
    ]
})
export default Router;